#  Lindsay Ergenekan 
#  ergenekl@onid.oregonstate.edu
#  CS311-400
#  Homework5 
#
#  $RCSfile$
#  $Revision$
#  $Author$
#  $Date$
#  $Log$
#

CC=gcc
DEBUG=-g
CFLAGS=$(DEBUG) -Wall -std=c99 -Wshadow -Wunreachable-code -Wmissing-declarations -Wold-style-definition -Wmissing-prototypes -Wdeclaration-after-statement
PROGS= pipeline

all: $(PROGS)

pipeline: pipeline.o
	$(CC) $(CFLAGS) -o pipeline pipeline.o hw5.h  

pipeline.o: pipeline.c
	$(CC) $(CFLAGS) -c pipeline.c 	

test2: pipeline.o
	@echo TEST PIPELINE
	@rm -f outfile1
	@rm -f outfile2
	@rm -f BASHoutfile3 
	@rm -f BASHoutfile4
	@sh pipeline.bash < words.txt > BASHoutfile3 filler BASHoutfile4
	@./pipeline -f outfile1 < words.txt > outfile2
	vimdiff BASHoutfile4 outfile1
	vimdiff BASHoutfile3 outfile2

test: pipeline.o
	@echo TEST PIPELINE
	@rm -f outfile1
	@rm -f outfile2
	@rm -f BASHoutfile3 
	@rm -f BASHoutfile4
	@sh pipeline.bash < words.txt > BASHoutfile3 filler BASHoutfile4
	@./pipeline -f outfile1 < words.txt > outfile2
	iff BASHoutfile4 outfile1
	iff BASHoutfile3 outfile2


uniqify: uniqify.o
	$(CC) $(CFLAGS) -o uniqify uniqify.o hw5.h  

uniqify.o: uniqify.c
	$(CC) $(CFLAGS) -c uniqify.c 

clean:
	rm -f $(PROGS) *.o *~

